package com.eeepay.eeepay_v2.adapter;

import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.View;

import com.eeepay.eeepay_v2.R;
import com.eeepay.eeepay_v2.model.MerchantInfo;
import com.eeepay.v2_library.adapter.ABBaseAdapter;
import com.eeepay.v2_library.adapter.ABViewHolder;

/**
 * Created by Ching on 2016/3/16.
 * 商户查询结果
 */
public class MerchantQueryAdapter extends ABBaseAdapter<MerchantInfo> {


    public MerchantQueryAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_merchant_query_list;
    }

    @Override
    public void convert(ABViewHolder holder, MerchantInfo info) {

        holder.setRightText(R.id.lrt_merchant_query_no, info.getNo());
        holder.setRightText(R.id.lrt_merchant_query_name, info.getName());
        holder.setRightText(R.id.lrt_merchant_query_phone, info.getPhone());
        //0：商户关闭；1：正常；2 冻结
//        if("0".equals(info.getState())){
//            holder.setRightText(R.id.lrt_merchant_query_state, "商户关闭");
//            holder.setRightTextColor(R.id.lrt_merchant_query_state, R.color.red);
//        }else if("1".equals(info.getState())){
//            holder.setRightText(R.id.lrt_merchant_query_state, "正常");
//            holder.setRightTextColor(R.id.lrt_merchant_query_state, R.color.green);
//        }else if("2".equals(info.getState())){
//            holder.setRightText(R.id.lrt_merchant_query_state, "冻结");
//            holder.setRightTextColor(R.id.lrt_merchant_query_state, R.color.red);
//        }
        holder.getView(R.id.lrt_merchant_query_state).setVisibility(View.GONE);
    }

}
